
def parse_data(req, request):
    try:
        req.ParseFromString(request.get_data())
    except Exception as e:
        print('Error: ', e)
        return None
    else:
        return req
